
const {
  mrjAsyncBaseReq, //  基本请求
  BaseRequestModel, // 基本请求对象
} = require('./mrhhttp')
const api_action_add = "user.add"
const api_action_delete = "user.delete"
const api_action_edit = "user.edit"
const api_load_list = "user.list"
const api_load_detail = "user.detail"




const UserHttp = {
  actionDelete:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_action_delete}`,
      api:api_action_delete,
      param: param
    });
    return res.data
  },
  actionAdd:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_action_add}`,
      api:api_action_add,
      param: param
    });
    return res.data
  },
  actionEdit:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_action_edit}`,
      api:api_action_edit,
      param: param
    });
    return res.data
  },
  loadList:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      api:api_load_list,
      url: `${BaseRequestModel.baseUrl}${api_load_list}`,
      param: param
    });
    return res.data
  },
  loadDetail:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_detail}`,
      api:api_load_detail,
      param: param
    });
    return res.data
  },
}
module.exports = UserHttp